//
//  NativeBleEnableChannel.m
//  kq_flutter_core_widget
//
//  Created by wtb on 2024/1/26.
//

#import "NativeBleEnableChannel.h"

@implementation NativeBleEnableChannel

#pragma mark 创建蓝牙状态通道对象
+(NativeBleEnableChannel *)registerStateWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar{
    FlutterEventChannel *enableChannel = [FlutterEventChannel eventChannelWithName:@"flutter.keqiang.com/bleEnableEvent" binaryMessenger:[registrar messenger]];
    NativeBleEnableChannel *enable = [[NativeBleEnableChannel alloc] init];
    [enableChannel setStreamHandler:enable];
    return enable;
}

- (FlutterError * _Nullable)onCancelWithArguments:(id _Nullable)arguments {
    self.eventSink = nil;
    return nil;
}

- (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments eventSink:(nonnull FlutterEventSink)events {
    self.eventSink = events;
    return nil;
}
@end
